﻿CREATE PROCEDURE [dbo].[GetRegistros]
	@DataInicio DATETIME = NULL,
	@DataFim DATETIME = NULL
AS
	SELECT * FROM HistoricoTreinamento HT
	WHERE
	(
		(@DataInicio IS NULL AND @DataFim IS NULL)
		OR
		(HT.DataImportacao >= @DataInicio AND HT.DataImportacao <= @DataFim)
	)